package com.test.sharding.utils;

import java.util.Random;

public class CharacterUtil {

    private static Random random = new Random(10);

    public static String getString() {
        return getRandomChar(random.nextInt());
    }

    private static String getRandomChar(int size) {
        int length = (size % 5) + 5;
        char[] chars = new char[length];
        for (int i = 0; i < length; i ++) {
            chars[i] = getRandomChar();
        }
        return new String(chars);
    }

    private static char getRandomChar() {
        return (char) (0x4e00 + (int) (Math.random() * (0x9fa5 - 0x4e00 + 1)));
    }

}
